<script setup>
import Son1Com from "@/components/Son1Com.vue";
import Son2Com from "@/components/Son2Com.vue";
import {useCounterStore} from "@/store/counter.js";
import {useChannelStore} from "@/store/channel.js";

const counterStore = useCounterStore();
// console.log(counterStore) // 对象

const channelStore = useChannelStore();
</script>

<template>
    <div>
        <h3>
            I am APP.
            - {{ counterStore.count }}
            - {{ counterStore.msg }}
        </h3>
        <Son1Com/>
        <Son2Com/>
        <hr>
        <button @click="channelStore.getList">获取频道数据</button>
        <ul>
            <li v-for="item in channelStore.channelList" :key="item.id">
                {{ item.name }}
            </li>
        </ul>
    </div>
</template>

<style scoped>

</style>